package com.yun.platform.iot.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yun.platform.iot.dto.AutoGroupDto;
import com.yun.platform.iot.entity.AutoGroup;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * 自动化与组关系表
 mapper
 */
@Repository
public interface AutoGroupMapper  extends BaseMapper<AutoGroup> {

    @Select("select a.*,g.group_name as 'groupName' from auto_group a left join group_main g  on a.group_id=g.id and a.auto_id=#{autoId} ")
    List<AutoGroupDto> findByAuthId(@Param("autoId")Integer autoId);
}